﻿<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Web报表(B/S报表)演示 - 用多种方法在报表中线显示i图像</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<script src="../CreateControl.js" type="text/javascript"></script>
	<script type="text/javascript">

function window_onload() 
{
    ReportViewer.Stop();
    
    var Report = ReportViewer.Report;
    Report.OnBeforePostRecord = OnBeforePostRecord;
    Report.OnInitialize = OnInitialize;
    Report.OnProcessRecord = OnProcessRecord;

    //启动报表运行
    ReportViewer.Start();
}

function OnInitialize()
{
    var Report = ReportViewer.Report;
    
	//从文件的 URL 中载入图像数据
	Report.ControlByName("FilePictureTitleBox").AsPictureBox.LoadFromFile("../../images/Title.jpg");
	
	//从动态的 URL 中载入图像数据
	Report.ControlByName("URLPictureBox").AsPictureBox.LoadFromFile("PictureFromDB.jsp");
}

function OnBeforePostRecord()
{
    var Report = ReportViewer.Report;
    
    //让字段值为图像文件的完整URL或文件路径名
    var pathFile = "../../images/" + Report.FieldByName("PictureFile").AsString + ".bmp";
    Report.FieldByName("PicturePathFile").AsString = pathFile;
}

function OnProcessRecord()
{
    var Report = ReportViewer.Report;
    
    //根据图像文件的完整URL或文件路径名载入
	var PathFile = "../../images/" + Report.FieldByName("PictureFile").AsString + ".bmp";
	Report.ControlByName("FilePictureBox").AsPictureBox.LoadFromFile(PathFile);
}
    </script>

    <style type="text/css">
        html,body {
            margin:0;
            height:100%;
        }
    </style>
</head>
<body style="margin:0" onload="return window_onload()">
    <script type="text/javascript"> 
	    //CreatePrintViewerEx("100%", "100%", "Picture.grf", "xmlPicture.jsp", false, "<param name=GridCenterView value=false>");
	    CreateDisplayViewerEx("100%", "100%", "Picture.grf", "xmlPicture.jsp", false, "<param name=GridCenterView value=false>");
    </script>
</body>
</html>
